From aefa50645cad7982f8b2b1ab33995cafe32787b2 Mon Sep 17 00:00:00 2001 From: Suravee Suthikulpanit Date: Wed, 8 Jun 2016 14:13:59 +0200 Subject: [PATCH] x86/hvm: add check when register io handler At the time of registering HVM I/O handler, the HVM domain might not have been initialized, which means the hvm_domain.io_handler would be NULL. In the hvm_next_io_handler(), this should be asserted. Signed-off-by: Suravee Suthikulpanit Reviewed-by: Paul Durrant --- xen/arch/x86/hvm/intercept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index fc757d0af7..bf141c9905 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; + ASSERT(d->arch.hvm_domain.io_handler); + if ( i == NR_IO_HANDLERS ) { domain_crash(d); -- 2.30.2